clear 
cd  "C:\Users\roro\Dropbox\RoRoPeff\German Survey\Germany 2019\Papers\Manuscript\Take 4\Pol Beh Submission\Replication Files"

***The following will be included in the replication files:
use 		"Pol_Beh_IPSOS_Replication_Data.dta" ,clear // data contains all variables used to produce the following text and appendix figures and tables

*************************************************
****TABLES & FIGURES IN THE MAIN TEXT************
*************************************************

***Figure 1*** is a conceptual figure; thus there is no replication data for it****

***Figure 2***
histogram 	populism525r_01 , fcolor(gs10) lcolor(gs15) discrete percent xtitle(Populist Attitudes)

***Table 1***

	*Model1
	reg 		curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01   c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1 [aweight=weight_total]
	estimates 	store model1

	*Model2
	reg 		curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02##rnd_burk_dec_01 c.lr_self_01 age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 
	estimates 	store model2

	*produce TABLE 1 
	esttab  	model1 model2 , b(%6.2f) se(%6.2f) stats(N r2_a) label nodepvars type  wide  noeform nogaps    replace

***Figure 3 (based on Model 1)***
	reg 		curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01   c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1    [aweight=weight_total]

	margins,	at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))
	label define 	populism525r_01 0 "", modify 
	label define 	populism525r_01 1 "", modify

	marginsplot, xdimension(populism525r_01) ytitle("Support Overturn Curbing (0-1)", size(medium)) xtitle(Populist Attitudes) title("") ylabel(0(.1).6) recast(line) recastci(rarea) 	 ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) ///
		legend(order(4 "FCC" 5 "Bundestag" 6 "EU"  )rows(1)) ///
		addplot (hist populism525r_01,fraction start(0) width(.1)fcolor(gs15)) 
	gr_edit .legend.plotregion1.key[4].draw_view.setstyle, style(no)
	gr_edit .legend.plotregion1.label[4].text = {}

***FIGURE 4 (based on Model 2)***
	reg curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02##rnd_burk_dec_01 c.lr_self_01 age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 [aweight=weight_total]
	margins, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2) rnd_burk_dec_01=(0 1))
	marginsplot, xdimension(populism525r_01) ytitle("Support Curbing (0-1)", size(medium)) xtitle(Populism) title("") ylabel(0(.1).6)  ///
				recast(line) recastci(rarea) ciopts( color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(longdash_dot)) ///
				bydimension(rnd_burk_dec_01,label("Decision Illegal" "Decision Legal"))byopts(title(""Title"")) 
	

****TABLES & FIGURES IN THE APPENDIX************
***Table A1.A Demographics of Ipsos Sample Compared to Population Statistics*** 

***Table A2*** Confirmatory Factor Analysis of Ipsos Populism Indicators Loading on a Single Factor
	sem (pop1_betray pop2_parlwill pop3_polpriv  pop5_stronglead pop6_ordinary<- Dim),covstruct(_lexogenous, diagonal) latent(Dim1) variance (Dim1@1 ) ///
		standardized iterate(100)cov(e.pop3_polpriv*e.pop5_stronglead)cov(e.pop2_parlwill*e.pop3_polpriv)cov((e.pop2_parlwill*e.pop6_ordinary))
	estat gof,stats(all)
	estat mindices


***Figure A1*** Predicting Populism Using Respondents' Left-Right Ideological Self-Placement
	regress 		populism525r_01 c.lr_self_01##c.lr_self_01
	margins,		at(lr_self_01=(0(.1)1))
	marginsplot, 	ytitle("Oppose (0) Support Populism (1)", size(medium)) xtitle(left(0)right(1)self-placement) title("") ylabel(0(.1)1)  recast(line) recastci(rarea) ciopts(				color(*.4%50)) 

***Figure A2*** Mean Support for Curbing across Institutions and Separate Indicators
	mean 			overturn_burkr_01  comply_burk_01  if rnd_burk_inst_02==0  [aweight=weight_total]

	estimates 		store FCC 

	mean 			overturn_burkr_01  comply_burk_01   if rnd_burk_inst_02==1  [aweight=weight_total]

	estimates 		store Parl 

	mean 			overturn_burkr_01  comply_burk_01   if rnd_burk_inst_02==2   [aweight=weight_total]

	estimates 		store EU 
	coefplot FCC Parl EU, ///
		 vertical recast(bar) ///
		 barwidth (0.15) fcolor (*.5) ///
		 ciopts(recast(rcap))citop  ///
		 xtitle(variables)   ///
		 ytitle(Mean)  

*Figure A3*** Graphing Effects of Curbing Support for Overturn (left) and Comply (right) Indicators. Compare to Figure 4 in the Main Text
	reg 			overturn_burkr_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01  c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1  [aweight=weight_total]

	estimates 		store model3

	margins, 		at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))

	marginsplot, 	xdimension(populism525r_01) ytitle("Support Overturn Decision (0-1)", size(medium)) xtitle(Populism) title("") ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) 

	reg 			comply_burk_01  c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01  c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1  [aweight=weight_total]

	estimates 		store model4

	margins, 		at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))

	marginsplot, 	xdimension(populism525r_01) ytitle("Oppose Compliance (0-1)", size(medium)) xtitle(Populism) title("") ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) 

				
**Table A3*** Predicting Support for Curbing on Burqa Issue for Each Institution Separately, with Partisanship Excluded (Models 1,3,5) and Included (2,4, 6). 
	*FCC without party_close dummies
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01  WE  if rnd_burk_inst_02==0 [aweight=weight_total]

	estimates 		store FCC_2

	*Parl without party_close dummies
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01  WE if  rnd_burk_inst_02==1  [aweight=weight_total]

	estimates store PAR_2
	*EU without party_close dummies

	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01  WE  if rnd_burk_inst_02==2 [aweight=weight_total]

	estimates store EU_2

	*FCC with party_close dummies
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01   age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 if rnd_burk_inst_02==0 [aweight=weight_total]

	estimates 		store FCC_3

	*Parl with party_close dummies
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 if rnd_burk_inst_02==1  [aweight=weight_total]

	estimates store PAR_3

	*EU with party_close dummies
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 if rnd_burk_inst_02==2 [aweight=weight_total]

	estimates 		store EU_3

	esttab  		FCC_2 FCC_3  PAR_2 PAR_3  EU_2 EU_3 using Burkindex2_MP.rtf , b(%6.2f) se(%6.2f) stats(N r2_a) label nodepvars type noeform nogaps    replace

***Table A4*** Estimating Effects of Date of Completion: models 2, 4, 6 in Table A4 
	*FCC
	reg 			curb2_burk_01 c.populism525r_01  rnd_burk_dec_01  c.lr_self_01   age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 i.enddate_day if  rnd_burk_inst_02==0 [aweight=weight_total]

	estimates 		store FCC_3

	*Parl
	reg 			curb2_burk_01 c.populism525r_01 rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01 WE enddate_day ib6.party_close1  i.enddate_day if rnd_burk_inst_02==1  [aweight=weight_total]
	estimates 		store PAR_3

	*EU
	reg 			curb2_burk_01 c.populism525r_01 rnd_burk_dec_01  c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01 WE enddate_day ib6.party_close1  i.enddate_day if rnd_burk_inst_02==2 [aweight=weight_total]
	estimates 		store EU_3

	esttab   		FCC_3   PAR_3   EU_3 using Burkindex2_MP.rtf , b(%6.2f) se(%6.2f) stats(N r2_a) label nodepvars type noeform nogaps    replace


*Table A5. Germany is a Typical Case on Key Variables: Comparing the Structure and Meaning of Populism Indicators for Germany to 16 Democracies, CSES5
***See CSES do files and data set. 

*Figure A4. Germany is a Typical Case on Key Variables: Comparing the Mean Level of Support for Populism across 17 Democracies (CSES 5).
***See CSES do files and data set. 


*Figure A5: Germany is a Typical Case on Key Variables: Confidence in the Judiciary, Parliament, and the EU
***See EVS do files and data set

*Figure A6. Manipulation Check Predicting Support for the Decision: Populists Are More Supportive of the Illegal Decision than the Legal Decision
	reg supp_burk_r_01 c.populism525r_01##i.rnd_burk_inst_02##rnd_burk_dec_01 c.lr_self_01  age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1 [aweight=weight_total]
	set level 95
	margins, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2) rnd_burk_dec_01=(0 1))
	marginsplot, xdimension(populism525r_01) ytitle("Support Decision (0-1)", size(medium)) xtitle(Populism) title("") ylabel(0(.1)1)  recast(line) recastci(rarea) ciopts( color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid)) plot3opts(lpattern(longdash_dot)) ///
			bydimension(rnd_burk_dec_01,label("Decision Illegal" "Decision Legal"))byopts(title(""Title""))


*Figure A7. Contrasts of Predicted Values for Support for Curbing across Illegal vs. Legal Decisions for the Three Institutions
	reg curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02##rnd_burk_dec_01 c.lr_self_01 age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1  [aweight=weight_total]
					margins,dydx(populism525r_01)at(rnd_burk_inst_02=(0(1)2)rnd_burk_dec_01=(0 1)) 		
					margins rnd_burk_dec_01, at(populism525r_01=1)at(rnd_burk_inst_02=(0(1)2))
					margins, dydx(rnd_burk_dec_01) at(populism525r_01=1)at(rnd_burk_inst_02=(0(1)2))			
					set level 90
					margins r.rnd_burk_dec_01, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2)) contrast(pveffects nowald) vsquish
					marginsplot, bydimension(rnd_burk_inst_02) recast(line) recastci(rarea) ciopts(color(*.4%50)) yline(0)
					
*Figure A8. Comparing Predicted Values for Support for Curbing the FCC across Left-Right Self-Placement for Illegal vs. Legal Decisions
*Switching lr_self_01 for populism in Model 2 of Table 1
reg curb2_burk_01 c.lr_self_01##i.rnd_burk_inst_02##rnd_burk_dec_01 c.populism525r_01 age_recoded_01 female income_home_01 educ_nomiss_01 WE ib6.party_close1   [aweight=weight_total]
margins, at(lr_self_01=(0(.1)1) rnd_burk_inst_02=(0) rnd_burk_dec_01=(0 1))
marginsplot, xdimension(lr_self_01) ytitle("Support Curbing (0-1)", size(medium)) xtitle(Left-Right Self-Placement (0 to 1)) title("") ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts( color(*.4%50)) 

*Figure A9. Predicting Curbing Support from Populism, Institutions and Political Involvement 
reg curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01   c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1    [aweight=weight_total]
          estimates store model1_allpartic
          margins, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))
*SAME AS FIGURE 3 IN TEXT
marginsplot, xdimension(populism525r_01) ytitle("Support for Curbing (0-1)", size(medium)) xtitle(Populism) title("") 		ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) legend(order(4 "FCC" 5 "Parliament" 6 "EU")col(3)) name(model1_allpartic, replace) 
					margins,dydx(populism525r_01)at(rnd_burk_inst_02=(0(1)2) ) 

***Low partic4_dum
	reg curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01   c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1  if partic4_dum==0   [aweight=weight_total]
		estimates store model2_lowpartic
		  margins, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))
	*low partic4_dum
marginsplot, xdimension(populism525r_01) ytitle("Support for Curbing (0-1)", size(medium)) xtitle(Populism) title("") 		ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) legend(order(4 "FCC" 5 "Parliament" 6 "EU")col(3)) name(model2_lowpartic, replace)
						margins,dydx(populism525r_01)at(rnd_burk_inst_02=(0(1)2) ) 
						
***Hi partic4_dum
	reg curb2_burk_01 c.populism525r_01##i.rnd_burk_inst_02  rnd_burk_dec_01  c.lr_self_01   c.age_recoded_01  female  c.income_home_01  c.educ_nomiss_01  WE ib6.party_close1  if partic4_dum==1  [aweight=weight_total]
					estimates store model3_hipartic
			  margins, at(populism525r_01=(0(.1)1) rnd_burk_inst_02=(0(1)2))
	*Hi partic4_dum
marginsplot, xdimension(populism525r_01) ytitle("Support for Curbing (0-1)", size(medium)) xtitle(Populism) title("") 		ylabel(0(.1).6)  recast(line) recastci(rarea) ciopts(color(*.4%50)) plot1opts (lpattern(dash))plot2opts(lpattern(solid))plot3opts(lpattern(dot)) legend(order(4 "FCC" 5 "Parliament" 6 "EU")col(3)) name(model3_hipartic, replace)
						margins,dydx(populism525r_01)at(rnd_burk_inst_02=(0(1)2) ) 

***Combine 3 graphs to produce FIGURE A9
graph combine model1_allpartic  ///
	model2_lowpartic ///
	model3_hipartic,c(3) title("Populism & Curbing Support for All, Low & High Pol Involvement Groups", size(medium))

*Produce TABLE A6
esttab   model1_allpartic model2_lowpartic model3_hipartic using Burkindex2_MP.rtf , b(%6.2f) se(%6.2f) stats(N r2_a) label nodepvars type noeform nogaps    replace

*******************************************************************************			


